// import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import get from '@dfeidao/atom-web/storage/get';
import { IFeidaoAiBrowserComponent } from '@dfeidao/web/interfaces';
import hide_loading from '../../atom/hide-loading';
import show_loading from '../../atom/show-loading';

import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
// import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import P03 from './P03';
import P04 from './P04';
export default async function a000(fd: IFeidaoAiBrowserComponent, role_no: string, ff: string) {
	//  调用事件
	fd.data.node.querySelector<HTMLDivElement>('[id="zj12"]').classList.remove('display-n');

	set(fd, 'ff', ff);
	set(fd, 'role_no', role_no);
	const productid = get('productid');

	set(fd, 'productid', productid);
	show_loading();
	const data = await nodejs<{ length: number }>('roler/service/auth_formgroup_find2', { productid, role_no });
	hide_loading();
	if (data.length === 0) {
		render(fd, '', P03, 'P03', 'inner');
		render(fd, '', P04, 'P04', 'inner');
	} else {
		render(fd, data, P03, 'P03', 'inner');
		fd.data.node.querySelector<HTMLDivElement>('[data-feidao-presentation="P04"]').innerHTML = '';
	}
}
